﻿
Imports System.Web.Routing
Imports System.Web.Http

Imports Microsoft.AspNet.FriendlyUrls
Imports Moca.Web

Public Module RouteConfig

	Sub RegisterRoutes(ByVal routes As RouteCollection)
		routes.EnableFriendlyUrls()
		' Web API 用
		routes.MapHttpRoute(name:="DefaultApi",
							routeTemplate:="api/{controller}/{id}",
							defaults:=New With {.id = System.Web.Http.RouteParameter.Optional}
							).RouteHandler = New SessionHttpControllerRouteHandler


		'routes.RouteExistingFiles = True

		routes.Add("Root", New Route("", New CustomRouteHandler("~/Views/Index.aspx")))
		routes.Add("Index", New Route("Index.aspx", New CustomRouteHandler("~/Views/Index.aspx")))
		routes.Add("Setup", New Route("Setup.aspx", New CustomRouteHandler("~/Views/Setup.aspx")))
		'routes.Add("Login", New Route("Login.aspx", New CustomRouteHandler("~/Views/Login.aspx")))
		'routes.Add("Error", New Route("Error.aspx", New CustomRouteHandler("~/Views/Error/Error.aspx")))
		'routes.Add("Error404", New Route("Error404.aspx", New CustomRouteHandler("~/Views/Error/Error404.aspx")))
		'routes.Add("Error403", New Route("Error403.aspx", New CustomRouteHandler("~/Views/Error/Error403.aspx")))
		'routes.Add("Maintenance", New Route("Maintenance.aspx", New CustomRouteHandler("~/Views/Maintenance.aspx")))
		'routes.Add("Signout", New Route("Signout.aspx", New CustomRouteHandler("~/Views/Signout.aspx")))
		'routes.Add("Timeout", New Route("Timeout.aspx", New CustomRouteHandler("~/Views/Timeout.aspx")))

		'routes.Add("Admin", New Route("Admin", New CustomRouteHandler("~/Views/Admin/Index.aspx")))
		'routes.Add("Dev", New Route("Dev", New CustomRouteHandler("~/Views/Dev/Index.aspx")))

		'routes.Add("Admin.aspx", New Route("Admin.aspx", New CustomRouteHandler("~/Views/Admin/Index.aspx")))
		'routes.Add("Dev.aspx", New Route("Dev.aspx", New CustomRouteHandler("~/Views/Dev/Index.aspx")))

		'routes.Add("Index2", New Route("Index2.aspx", New CustomRouteHandler("~/Views/Index2.aspx")))
	End Sub

End Module
